package com.frp.protocol;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * 新建代理响应消息
 */
public class NewProxyRespMessage extends Message {
    @JsonProperty("proxy_name")
    private String proxyName;
    
    @JsonProperty("error")
    private String error;
    
    @JsonProperty("remote_addr")
    private String remoteAddr;
    
    @JsonProperty("remote_port")
    private int remotePort;
    
    public NewProxyRespMessage() {
        super(MessageType.NewProxyResp);
    }
    
    public NewProxyRespMessage(String proxyName, String error) {
        super(MessageType.NewProxyResp);
        this.proxyName = proxyName;
        this.error = error;
    }
    
    // Getters and Setters
    public String getProxyName() { return proxyName; }
    public void setProxyName(String proxyName) { this.proxyName = proxyName; }
    
    public String getError() { return error; }
    public void setError(String error) { this.error = error; }
    
    public String getRemoteAddr() { return remoteAddr; }
    public void setRemoteAddr(String remoteAddr) { this.remoteAddr = remoteAddr; }
    
    public int getRemotePort() { return remotePort; }
    public void setRemotePort(int remotePort) { this.remotePort = remotePort; }
    
    public boolean isSuccess() {
        return error == null || error.isEmpty();
    }
}